1. Field of the Invention
The present invention relates to file systems, and in particular to a method for resolving a conflict between parallel user changes to two synchronized trees of folders and files.
Portions of the disclosure of this patent document contain material that is subject to copyright protection. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all rights whatsoever.
2. Background Art
A way to organize files and folders of a user on a computer is by arranging them in a structure commonly known as a tree. Oftentimes, files and folders are changed. When this happens, a new tree is generated. It is helpful sometimes to find and reconcile differences between the old and new trees. Reconciling differences could lead to conflict in changes that require indication as to which conflicting takes precedence. Resolving these conflicting changes currently is very difficult, as will be further explained below. Before discussing this problem, an overview of a tree data structure is provided.
Tree Data Structure
A tree data structure is illustrated in FIG. 1. The apex 100 of the tree is commonly called the root. The root is usually a folder that contains all other sub-folders and files of a user. The root is the starting location of all folders and files of a computer user from where links spread out like branches of a tree to other sub-folders and files.
The nodes of the tree (i.e., the actual files) are denoted by parent, child, leaf, and non-leaf locations or nodes. A parent is any node that has a branch leading down to one or more lower nodes. In FIG. 1, root 100 is one example of a parent. A child is any node that has a branch leading up to a higher node. Referring back to FIG. 1, all nodes except the root is a child node. This child node category can be further segregated into left and right child depending upon the location of the child node with respect to its parent. Node 101 is a right child node, while node 102 is a left child node of parent node 103. A leaf node is any node that does not have any branches leading to lower levels in the tree. All nodes at the bottom most level of the tree (for example, 104, 105, and 106) are leaf nodes. In contrast, all other nodes are categorized as non-leaf nodes as they have a child node under them (for example, 100).
Tree Modification
When a user makes changes to the folders and files, for instance by deleting or adding a file or changing its contents, these changes have to be correctly incorporated into the tree. Typically, a new tree is generated every time a change is made. This new tree is then compared to the old tree, and all necessary changes are reconciled to create one updated tree. Reconciling differences could lead to conflict in changes that require indication as to which conflicting change should win. This requires that the old state has to be remembered and compared with the new state in order to resolve any conflicting changes, which is wasteful of resources.
File Tree Conflict Processor
In order to resolve any conflicting changes between and old and a new file tree, the two trees have to be compared. A utility, commonly called a file tree comparator, compares the two file tree descriptions and generates a sequenced log of changes that transforms the old tree to a new tree. A complete description of one file tree comparator is contained in co-pending provisional U.S. patent application “File Tree Comparator”, Ser. No. 60/296,065 filed on Jun. 4, 2001, and co-pending non-provisional U.S. patent application “File Tree Comparator”, Ser. No. 10/021,943 filed on Dec. 12, 2001, and assigned to the assignee of this patent.
After the changes have been recorded, another utility, commonly known as a reconciler, takes in as its input the log of changes (if one is available) from both the old and the new file trees and reconciles any changes that have occurred since the last synchronization. A complete description of one file tree reconciler is contained in co-pending U.S. patent application “File Tree Change Reconciler”, Ser. No. 60/295,987 filed on Jun. 4, 2001, and co-pending U.S. patent application “File Tree Change Reconciler”, Ser. No. 10/021,854 filed on Dec. 12, 2001, and assigned to the assignee of this patent application.
When reconciling parallel user changes to two synchronized trees of folders and files, conflicting changes may be encountered that require indication as to which conflicting change takes precedence. These conflicting changes are handled by another utility commonly called a conflict processor. Some conflicting changes cannot be resolved independently, and those entangled conflicts have to be combined into one to be presented to the user as a single conflict. After the user indicates the winner of the conflict, the winning operations need to be applied to the file tree with which they are in conflict.
There are several commercially available conflict processors that find conflicting changes in two file tree structures. One file tree conflict processor is called Xfiles. Xfiles allows comparing, reconciling any changes, reconciling any conflicting changes, and merging two file trees over a network. In operation, Xfiles compares and merges the two file tree versions using a client/server program (graphical user interface on the client) that traverses the file trees and reports any files that are missing on the server or client machines, are different, or are conflicting with each other.
The main drawback with Xfiles is that the entire tree has to be traversed in order to find any conflicting changes to be reported to the user. Many trees are very large, in which case a substantial amount of time may be wasted traversing large portions of the tree that are not modified. Moreover, if the network connection is slow, or network traffic high, Xfiles becomes prohibitively wasteful of resources. A second drawback associated with Xfiles is that those conflicting changes have to be manually removed by the user. This compels the user to have a thorough knowledge of the entire file tree, and of all the changes made to it.
Another file tree conflict processor, termed Teamware, includes methods for finding differences in file trees, with the assumption that the file trees are of a special type—containing only SCCS folders and files—that are directly annotative. Using Teamware, developers may each be assigned a separate sub-directory of a single root directory designated as the parent workspace for a current project. The parent workspace contains the original copies of each project file and records of each set of changes to each file.
The developers obtain copies of project files for reading and editing purposes within their individual workspaces, and to record any modifications they make in the central location later on. A locking mechanism in SCCS prevents two developers from checking out the same file for editing at the same time. There are several drawbacks with Teamware, which include detecting file tree conflicting changes based on modification times rather than on change logs. Teamware is restricted further because it only works on SCCS folders and files, so, it has no application to most file tree systems.
Another file tree conflict processor is called Unison. Unison is a file synchronization tool for Unix and Windows operating systems. It allows two replicas of a collection of files, folders, or directories to be stored on different hosts or different disks on the same host, modified separately, and then brought up to date by propagating the changes in each replica to the other. Unison sends from one side (server or client) to the other the entire log, and makes the receiving side responsible for finding any conflicting changes in the files, folders, and directories of both sides. This system works well only because the utility has an indefinitely growing version log for each synced file, which is pruned only when all known synchronizers have seen the pruned versions. There is a time limit (usually a month) when the utility abandons files that have not been synced in order to prune the size of the log.
There are several drawbacks with this utility. A log for the entire file tree is sent across. If the file tree is large, the time involved in transmitting the log for the entire file tree can be time consuming, especially if the network connection is slow, or the network is highly congested. Moreover, a file not in use beyond the time limit is automatically abandoned by the log. If a user attempts to make certain changes to it, they may not be reflected in the log that is sent across to the other side. If these changes conflict, the user will be unaware of this causing synchronization problems. Furthermore, the conflict processor utility simply gives a list of all conflicts to the user, who has to manually resolve all conflicts. This compels the user to have a thorough knowledge of the entire file tree, and of all the changes made to it. This makes use of the tool difficult and unyielding.